# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=scrape-dns
pkgver=58.3df392f
pkgrel=3
groups=('blackarch' 'blackarch-scanner')
pkgdesc='Searches for interesting cached DNS entries.'
arch=('any')
url='https://github.com/304GEEK/Scrape-DNS'
license=('GPL2')
depends=('bash' 'dnsutils')
makedepends=('git')
source=("$pkgname::git+https://github.com/304GEEK/Scrape-DNS.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 -t "$pkgdir/usr/share/scrape-dns" Timing-Scrape.sh bar.sh \
    scrape.sh
  install -m 644 {all,custom,porn,updates}.list "$pkgdir/usr/share/$pkgname/"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec sh scrape.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

